package com.ruoyi.mall.app.repository;

import com.ruoyi.mall.common.domain.DtsGoodsEs;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DtsGoodsEsRepository extends ElasticsearchRepository<DtsGoodsEs, String> {
    // 查询商品信息
    @Query("{ \"match\": { \"search\": \"?0\" } }")
    List<DtsGoodsEs> findByNameContaining(String name);

    // 查询所有商品
    List<DtsGoodsEs> findAll();

}
